﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using RenAi.Medical.Model;
using RenAi.Medical.BLL;
using JiuMeiMall.PMethod;

namespace RenAi.Medical.Admin.Handler
{
    /// <summary>
    /// HandlerLogin 的摘要说明
    /// </summary>
    public class HandlerLogin : IHttpHandler
    {
        
        public void ProcessRequest(HttpContext context)
        {
            UsersBLL bll = new UsersBLL();
            context.Response.ContentType = "text/plain";
            string name = context.Request["uname"];
            string pwd = context.Request["upwd"];
            int i = bll.Login(name,pwd);
            if (i > 0)
            {
                JiuMeiMall.PMethod.CookieHelper.WriteCookie("renai", name);
            }
            context.Response.Write(i);
        }
        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}